import paramiko

client1 = paramiko.SSHClient()
client1.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client1.connect(hostname='12.18.0.16', port=22, username='oracle', password='oracle')
disk = 'sh /home/oracle/dbmonitor/ora   dbinfo'
stdin, stdout, stderr = client1.exec_command(str(disk))
##file_name = str(stdout.read(),'utf-8')
##com = 'cat /home/oracle/dbmonitor/' + file_name
#stdin, stdout, stderr = client1.exec_command(str(com))
##命令执行结果,readlines是将结果弄成列表方式
print (str(stdout.read(),'utf-8'))
print (stdout.readlines())
client1.close()